function throttle(func, delay) {
  let last = 0;
  return function(...args) {
    const now = Date.now();
    if (now - last > delay) {
      last = now;
      func.apply(this, args);
    }
  }
}
export default{
    data(){
        return {
			isChangeBarColor: true,
			scrollTop: 0
        }
    },
	onPageScroll: throttle(function(e) {
	    this.scrollTop = e.scrollTop
	    if(this.isChangeBarColor){
	    	uni.setNavigationBarColor({
	    		frontColor: this.scrollTop>20?'#000000':'#ffffff',
				backgroundColor: '#ffffff'
	    	})
	    }
	}, 200)
}